<?php
namespace app\index\controller;
use app\index\model\Send;
error_reporting(0);
class Email extends \think\Controller
{

	public function email()
	{
		if(request()->isPost()){
			$Send = new Send;
			$result = $Send->email([
				'email'  => input('post.email/s','','trim,strip_tags'),
				'subject'  => input('post.subject/s','','trim,strip_tags'),
				'message'  => input('post.message/s','','trim,strip_tags'),
			]);
			//halt($result);
			if($result !== true){
				return $this->error($result);
			}
			return $this->success('邮件发送成功');
		}
		return $this->fetch();
	}
}